package com.eg.thingscloud.example.service;

import retrofit2.Call;
import retrofit2.http.HEAD;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by liangjiange on 2017/3/17.
 */
public interface ThingscloudService {

    @POST("door/open")
    Call<String> openDoor(@Header("access_token") String token, @Header("timestamp") String timestamp,
                          @Header("sign_method") Integer signMethod, @Header("sign") String sign,
                          @Query("door_id") String doorId);

    @POST("card/openright/add/continuous")
    Call<String> continuousCardOpenRightAdd(@Header("access_token") String token, @Header("timestamp") String timestamp,
                                            @Header("sign_method") Integer signMethod, @Header("sign") String sign,
                                            @Query("door_id") String doorId,@Query("card_number") Long cardNumber,
                                            @Query("start_datetime") String startDateTime,
                                            @Query("end_datetime") String endDateTime,
                                            @Query("week_option") String weekOption);

    @POST("card/openright/add/interval")
    Call<String> intervalCardOpenRightAdd(@Header("access_token") String token, @Header("timestamp") String timestamp,
                                            @Header("sign_method") Integer signMethod, @Header("sign") String sign,
                                            @Query("door_id") String doorId,@Query("card_number") Long cardNumber,
                                            @Query("start_date") String startDate,
                                            @Query("end_date") String endDate,
                                            @Query("valid_start_time") String validStartTime,
                                            @Query("valid_end_time") String validEndTime,
                                            @Query("week_option") String weekOption);

    @POST("card/openright/delete")
    Call<String> deleteCardOpenRight(@Header("access_token") String token, @Header("timestamp") String timestamp,
                                          @Header("sign_method") Integer signMethod, @Header("sign") String sign,
                                          @Query("door_id") String doorId,@Query("card_number") Long cardNumber);

    @POST("card/openright/freeze")
    Call<String> freezeCardOpenRight(@Header("access_token") String token, @Header("timestamp") String timestamp,
                                     @Header("sign_method") Integer signMethod, @Header("sign") String sign,
                                     @Query("door_id") String doorId,@Query("card_number") Long cardNumber);

    @POST("card/openright/unfreeze")
    Call<String> unfreezeCardOpenRight(@Header("access_token") String token, @Header("timestamp") String timestamp,
                                     @Header("sign_method") Integer signMethod, @Header("sign") String sign,
                                     @Query("door_id") String doorId,@Query("card_number") Long cardNumber);

    @POST("password/openright/add/continuous")
    Call<String> continuousPasswordOpenRightAdd(@Header("access_token") String token, @Header("timestamp") String timestamp,
                                                @Header("sign_method") Integer signMethod, @Header("sign") String sign,
                                                @Query("door_id") String doorId,@Query("owner_id") Long ownerId,
                                                @Query("password") String password,@Query("start_datetime") String startDateTime,
                                                @Query("end_datetime") String endDateTime,
                                                @Query("week_option") String weekOption);

    @POST("password/openright/add/interval")
    Call<String> intervalPasswordOpenRightAdd(@Header("access_token") String token, @Header("timestamp") String timestamp,
                                                @Header("sign_method") Integer signMethod, @Header("sign") String sign,
                                                @Query("door_id") String doorId,@Query("owner_id") Long ownerId,
                                                @Query("password") String password,@Query("start_date") String startDate,
                                                @Query("end_date") String endDate,@Query("valid_start_time") String validStartTime,
                                                @Query("valid_end_time") String validEndTime,@Query("week_option") String weekOption);

}
